package com.bdqn.systems.controller;


import com.bdqn.response.Result;
import com.bdqn.systems.entity.Menu;
import com.bdqn.systems.service.MenuService;
import com.bdqn.systems.vo.MenuNodeVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 菜单表 前端控制器
 * </p>
 *
 * @author cp
 * @since 2020-11-30
 */
@Api
@CrossOrigin
@RestController
@RequestMapping("/systems/menu")
public class MenuController {

    @Autowired
    private MenuService menuService;

    @GetMapping("/findAll")
    @ApiOperation(value = "获取菜单信息",notes = "获取所有菜单信息")
    public Result findAll(){
        List<MenuNodeVO> menuTree = menuService.findMenuTree();
        return Result.ok().data("menus",menuTree);
    }
}

